Add support for Sony GPS-CS3KA files.
authorrobertl <robertl>
Sun, 26 Apr 2009 02:36:18 +0000 (02:36 +0000)
committerrobertl <robertl>
Sun, 26 Apr 2009 02:36:18 +0000 (02:36 +0000)
nmea.c

diff --git a/nmea.c b/nmea.c
index abd81700e2c86ed2d626dc3109604fc27b8f2d0d..cbc81bd0bfe25c5347077b27fe14d0c4e35e2083 100644 (file)
--- a/nmea.c
+++ b/nmea.c
@@ -992,11 +992,21 @@ nmea_read(void)
                        /* special hack for Sony GPS-CS1 files:
                           they are fully (?) nmea compatible, but come with a header line like
                           "@Sonygps/ver1.0/wgs-84". */
+                       /* The Sony GPS-CS3KA extends that line even further
+                          so we now look for the second field to be / 
+                          delimited.
+                          @Sonygps/ver1.0/wgs-84/gps-cs3.0
+                        */
                           
                        /* Check the GPS datum */
                        cx = strchr(&ibuf[12], '/');
                        if (cx != NULL) {
+                               char *edatum;
                                sdatum = cx + 1;
+                               edatum = strchr(sdatum, '/');
+                               if (edatum) {
+                                       *edatum = 0;
+                               }
                                datum = GPS_Lookup_Datum_Index(sdatum);
                                if (datum < 0)
                                        fatal(MYNAME "/SonyGPS: Unsupported datum \"%s\" in source data!\n", sdatum);